﻿namespace Alkitab
{
    using System;
    using System.ComponentModel;

    public class AyatAlkitab : INotifyPropertyChanged
    {
        #region Fields

        private String ayatAsliValue;
        private String infoLainValue;

        #endregion Fields

        #region Constructors

        public AyatAlkitab(String ayatAsli)
        {
            this.ayatAsliValue = ayatAsli;
            this.infoLainValue = "";
        }

        #endregion Constructors

        #region Events

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion Events

        #region Properties

        public String ayatAsli
        {
            get
            {
                //if (infoLainvalue == null) return ayatAslivalue; else return ayatAslivalue + "\n\n" + infoLainvalue + "\n\n";
                return ayatAsliValue + infoLainValue;
            }
            set
            {
                if (value != this.ayatAsliValue)
                {
                    this.ayatAsliValue = value;
                    NotifyPropertyChanged("ayatAsli");
                }
            }
        }

        #endregion Properties

        #region Methods

        public void addInfo(String infoLain)
        {
            this.infoLainValue += infoLain + "\n";
        }

        public void removeInfo()
        {
            this.infoLainValue = "";
            NotifyPropertyChanged("ayatAsli");
        }

        public String toString()
        {
            return ayatAsliValue;
        }

        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        #endregion Methods
    }
}